﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
using System.IO;
using System.Xml;
using System.Text;
using RoadTeam.Standard;
using RoadTeam.Pase;
using RoadTeam.Standard.FM;
using RoadTeam.Pase.FM;
using System.Web.Script.Services;
using RoadTeam.BLL;
/// <summary>
/// 财务接口部分
/// </summary>
public partial class RoadTeamService : BaseService
{
    #region 获取单元表记录
    [WebMethod(Description = "获取单元表记录")]
    [SoapDocumentMethod]
    [ScriptMethod(UseHttpGet = true)]
    public FmMeterDegree GetMeterDegree(string OrganIdentitifer, int PageSize, int CurrentPage, int AllCount)
    {
        try
        {
            return MeterDegreePase.GetMeterDegree(OrganIdentitifer, PageSize, CurrentPage, AllCount);
        }
        catch (System.Exception ex)
        {
            throw RaiseException("GetMeterDegree", ex.Message, "1000", ex.Source, FaultCode.Server, ex, "OrganIdentitifer:" +
                OrganIdentitifer + "PageSize" + PageSize + "CurrentPage" + CurrentPage + "AllCount" + AllCount);
        }
    }
    #endregion

    #region 获取单元表记录总数量
    [WebMethod(Description = "获取单元表记录总数量")]
    [SoapDocumentMethod]
    public int GetMeterDegreeCount(string OrganIdentitifer)
    {
        try
        {

            return MeterDegreePase.GetMeterDegreeCount(OrganIdentitifer);
        }
        catch (System.Exception ex)
        {
            throw RaiseException("GetMeterDegreeCount", ex.Message, "1000", ex.Source, FaultCode.Server, ex, "OrganIdentitifer:" + OrganIdentitifer);
        }
    }
    #endregion

    #region  更新单元表记录
    [WebMethod(Description = "更新单元表记录")]
    [SoapDocumentMethod]
    public bool UpdateMeterDegree(string Json)
    {
        try
        {
            return MeterDegreePase.UpdateMeterDegree(Json);
        }
        catch (System.Exception ex)
        {
            throw RaiseException("UpdateMeterDegree", ex.Message, "1000", ex.Source, FaultCode.Server, ex, "Json:" + Json);
        }
    }
    #endregion

    #region 获取单元表记录实现跨域
    [WebMethod(Description = "获取单元表记录实现跨域")]
    [SoapDocumentMethod]
    [ScriptMethod(UseHttpGet = true)]
    public void GetMeterDegreeCrossDoMain(string OrganIdentitifer, int PageSize, int CurrentPage, int AllCount)
    {
        try
        {
            BllBase bllbase = new BllBase();
            bllbase.InsertLog(@"方法名[GetMeterDegreeCrossDoMain]调用时间[" + DateTime.Now.ToString() + "] 参数为:[" + OrganIdentitifer + "," + PageSize + "," + CurrentPage + "," + AllCount + "]",
@"RoadTeam.Pase.PaseHomeInspection", "public static CsDoorType GetDoorType(String OrganIdentifier)");
            String Degree = MeterDegreePase.GetMeterDegree(OrganIdentitifer, PageSize, CurrentPage, AllCount, false);
            string jsoncallback = HttpContext.Current.Request["jsoncallback"];
            string result = jsoncallback + "(" + Degree + ")";
            HttpContext.Current.Response.Write(result);
            HttpContext.Current.Response.End();
        }
        catch (System.Exception ex)
        {
            throw RaiseException("GetMeterDegreeCrossDoMain", ex.Message, "1000", ex.Source, FaultCode.Server, ex, "OrganIdentitifer:" +
                OrganIdentitifer + "PageSize" + PageSize + "CurrentPage" + CurrentPage + "AllCount" + AllCount);
        }
    }
    #endregion

    #region 获取单元表记录总数量实现跨域
    [WebMethod(Description = "获取单元表记录总数量实现跨域")]
    [SoapDocumentMethod]
    public void GetMeterDegreeCountDoMain(string OrganIdentitifer)
    {
        try
        {
            BllBase bllbase = new BllBase();
            bllbase.InsertLog(@"方法名[GetMeterDegreeCountDoMain]调用时间[" + DateTime.Now.ToString() + "] 参数为:[" + OrganIdentitifer + "]",
@"RoadTeam.Pase.PaseHomeInspection", "public static CsDoorType GetDoorType(String OrganIdentifier)");
            int i = MeterDegreePase.GetMeterDegreeCount(OrganIdentitifer);
            string jsoncallback = HttpContext.Current.Request["jsoncallback"];
            string result = jsoncallback + "(" + i + ")";
            HttpContext.Current.Response.Write(result);
            HttpContext.Current.Response.End();
        }
        catch (System.Exception ex)
        {
            throw RaiseException("GetMeterDegreeCount", ex.Message, "1000", ex.Source, FaultCode.Server, ex, "OrganIdentitifer:" + OrganIdentitifer);
        }
    }
    #endregion


    #region  更新单元表记录实现跨域
    [WebMethod(Description = "更新单元表记录实现跨域")]
    [SoapDocumentMethod]
    public void UpdateMeterDegreeCountCrossDoMain(string Json)
    {
        try
        {
            BllBase bllbase = new BllBase();
            bllbase.InsertLog(@"方法名[UpdateMeterDegreeCountCrossDoMain]调用时间[" + DateTime.Now.ToString() + "] 参数为:[" + Json + "]",
@"RoadTeam.Pase.PaseHomeInspection", "public void UpdateMeterDegreeCountCrossDoMain(string Json)");
            string jsoncallback = HttpContext.Current.Request["jsoncallback"];
            string result = jsoncallback + "(" + (MeterDegreePase.UpdateMeterDegree(Json)?1:0) + ")";
            HttpContext.Current.Response.Write(result);
            HttpContext.Current.Response.End();
        }
        catch (System.Exception ex)
        {
            throw RaiseException("UpdateMeterDegree", ex.Message, "1000", ex.Source, FaultCode.Server, ex, "Json:" + Json);
        }
    }
    #endregion


}